<html>

<head>
    <script src="./libs/dat.gui.js"> </script>
    <script src="https://unpkg.com/vue"></script>

    <div id="app">
        <p>Original message: "{{ message }}"</p>
        <p>Computed reversed message: "{{ reversedMessage }}"</p>
        <p>Computed reversed message2: "{{ reversedMessage2() }}"</p>
    </div>
</head>

<body>
    <script>
        var gui = new dat.GUI();
        gui.open();

        var app = new Vue({
            el: '#app',
            data: {
                message: 'jiefu',
            },
            computed: {
                // 计算属性的 getter
                reversedMessage: function () {
                    // `this` 指向 vm 实例
                    return this.message.split('').reverse().join('')
                }
            },
            methods: {
                reversedMessage2: function () {
                    return this.message.split('').reverse().join('')
                }
            },
            beforeCreate: function () {
                console.log('beforeCreate');
            },
            created: function () {
                console.log('created');
            },
            beforeMount: function () {

            },
            mount: function () {

            }
        });

        var folder = gui.addFolder('App');
        folder.open();
    </script>
</body>

</html>